import service from "../index.js";

const goodsApi = {
    //添加老人
    insert(goods){
        return service.post('/admin/goods',goods);
    },
    //根据id删除
    delete(id){
        return service.delete(`/admin/goods/${id}`)
    },
    //修改
    update(goods){
        return service.put('/admin/goods',goods);
    },
    //查询所有
    selectByPage(pageNum, pageSize, goods){
        goods.pageNum = pageNum;
        goods.pageSize = pageSize;
        //请求参数
        return service.get('/admin/goods', {params: goods});
    },
    //根据id查询
    selectByID(id){
        return service.get(`/admin/goods/${id}`)
    },
}
export default goodsApi;